package com.victor.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.victor.dao.ActivityDao;
import com.victor.entity.Activity;
import com.victor.entity.ActivityJD;
import com.victor.service.ActivityService;

@Service
public class ActivityServiceImpl implements ActivityService {

	@Autowired
	private ActivityDao dao;

	// 获取列表 （传type和jqclassid）
	@Override
	public List<Activity> getlist(String type, String jqclassid) {
		return dao.getlist(type, jqclassid);
	}

	// 通过id查询详情
	@Override
	public Activity getActivityXQ(String activityid) {
		return dao.getActivityXQ(activityid);
	}

	// 批量删除活动
	@Override
	public boolean deleteActivityByids(int[] acids) {
		return dao.deleteActivityByids(acids) > 0 ? true : false;
	}

	// 修改活动信息
	@Override
	public int updateActivi(Activity activity) {
		return dao.updateActivi(activity);
	}

	// 修改活动景点信息
	@Override
	public int updateactivityJD(List<ActivityJD> activityJDs) {
		for (ActivityJD activityJD : activityJDs) {
			dao.updateactivityJD(activityJD);
		}
		return 1;
	}
}
